package com.hk.webapp.bo;

import com.hk.webapp.bean.User;
import lombok.Data;

import java.util.Date;

/**
 * (C) Copyright 2017-2019
 * All rights reserved.
 * <p>
 * 小程序用户信息业务对象
 *
 * @author DreamerCK
 * @date 2019-05-14 12:46
 **/
@Data
public class XcxUserInfoBo {

    private String openId;
    private String nickName;
    private Integer gender;
    private String city;
    private String province;
    private String country;
    private String avatarUrl;
    private String unionid;
    private String loginIp;

    public User convertXcxUserInfoBo2User(){
        User user = new User();
        user.setWxOpenid(this.openId);
        user.setWxNickname(this.nickName);
        user.setWxGender(this.gender);
        user.setWxCity(this.city);
        user.setWxProvince(this.province);
        user.setWxCountry(this.country);
        user.setWxAvatarUrl(this.avatarUrl);
        user.setWxUnionid(this.unionid);
        user.setLastLoginIp(this.loginIp);
        user.setLastLoginTime(new Date());
        return user;
    }
}
